package p.ithorns.tools.translator.sdk.handler;

import com.google.auto.service.AutoService;
import p.ithorns.tools.translator.annotation.field.SvcFiled;
import p.ithorns.tools.translator.annotation.Translator;

/**
 * SvcTransformer
 *
 * 字典服务转换
 *
 * @author Ht.L
 * @version 1.0.0
 * @date 2023/4/5 19:29
 */
@AutoService(Translator.class)
public class SvcTranslator implements Translator<String, SvcFiled> {

    @Override
    public String translate(SvcFiled annotation, String originalValue) {
        String group = annotation.group();

//        Map<String, String> dict = TranslatorContextHolder.getLocalMap()
//                .computeIfAbsent(annotation.group(), type -> Dict.getDict(annotation.group()));
//        return dict.get(value);

        return originalValue.equals("yc") ? "宜昌" : "武汉";
    }


}